#ifndef N2BITMAPREP_H_2009_11_11
#define N2BITMAPREP_H_2009_11_11

#include "N1Lib.h"
#include "N2Geometry.h"

class N2BitmapRep {
public:
    typedef enum { Bit_Copy } N2BitOperation;

    N2BitmapRep(uint16 bitsPerPixel, uint32 width, uint32 height);
    virtual ~N2BitmapRep();

    uint32 getBitsPerPixel() const { return m_nBPP; };

    N2Size getSize() const { return m_size; };

    uint32 getPixel(uint32 x, uint32 y) const ;
    void   setPixel(uint32 x, uint32 y, uint32 color);

    void   drawHorzLine(uint32 x1, uint32 x2, uint32 y, uint32 color);
    void   drawVertLine(uint32 x, uint32 y1, uint32 y2, uint32 color);

    bool copyRect(const N2BitmapRep& from, const N2Rect &dest, 
                  uint32 xSrc, uint32 ySrc, N2BitOperation op);

    bool stretchRect(const N2BitmapRep& from, const N2Rect &dest, 
                     const N2Rect &src, N2BitOperation op);

protected:
    char *m_pData;
    uint32 m_nByteInRow;
    uint32 m_nSize;
    N2Size m_size;
    uint32 m_nBPP;

private:
    N2BitmapRep(const N2BitmapRep& b);
    N2BitmapRep& operator=(const N2BitmapRep& b);
};

#endif //N2BITMAPREP_H_2009_11_11
